home *** CD-ROM | disk | FTP | other *** search
/ The National Palace Museum Experience / The National Palace Museum Experience.iso / Programs / Object.dxr / 00084.ls < prev    next >
Encoding:
Text File  |  1998-11-19  |  3.6 KB  |  140 lines

  1. global gqtvrinstance, qtvrpath, gpictfilepath, objectlist, objpos, bkgrdlist, objpropertylist, poslist, objnum, objpctsprite, objnamesprite, returnframe
  2.  
  3. on prepareMovie
  4.   set qtvrpath to "..\Qtvr\"
  5.   set gpictfilepath to "..\Image\"
  6.   set objpctsprite to 9
  7.   set objnamesprite to 10
  8.   set returnframe to label("Restart") + 1
  9.   set poslist to [point(464, 157), point(188, 157), point(188, 320), point(464, 320)]
  10.   set objnum to the text of field "Current Object"
  11.   set the volume of sound 1 to 110
  12.   cursor(-1)
  13. end
  14.  
  15. on startMovie
  16.   if soundBusy(1) then
  17.     sound stop 1
  18.   end if
  19.   playthesound(1, "..\Audio\Music3.wav")
  20.   initialbutton()
  21.   createcodelist()
  22.   repeat with objpropertylist in objectlist
  23.     set objnum to getAt(objpropertylist, 1)
  24.     if objnum = the text of field "Current Object" then
  25.       set objpos to getOne(objpropertylist, objnum)
  26.       exit repeat
  27.     end if
  28.   end repeat
  29. end
  30.  
  31. on initialbutton
  32.   repeat with spriteNum = 11 to 16
  33.     set the visible of sprite spriteNum to 1
  34.     puppetSprite(spriteNum, 0)
  35.   end repeat
  36.   set the visible of sprite 23 to 1
  37.   set the visible of sprite 24 to 1
  38. end
  39.  
  40. on stopMovie
  41.   gobackpath()
  42. end
  43.  
  44. on recttostr myrect
  45.   set mystring to string(myrect)
  46.   delete char 1 to 5 of mystring
  47.   delete char the length of mystring of mystring
  48.   return mystring
  49. end
  50.  
  51. on closemovie
  52.   if isqtvrmovie(gqtvrinstance) then
  53.     qtvrclose(gqtvrinstance)
  54.   end if
  55. end
  56.  
  57. on openqtvr
  58.   qtvrenter(xtra("QTVRXtra"))
  59.   set gqtvrinstance to new(xtra("QTVRXtra"))
  60.   set qtvrRect to recttostr(the rect of sprite 120)
  61.   set qtvrFile to the pathName & qtvrpath & "P" & the text of field "Current Object" & "0.mov"
  62.   qtvropen(gqtvrinstance, qtvrFile, qtvrRect, "visible")
  63.   en()
  64. end
  65.  
  66. on createcodelist
  67.   set filelist to "ObjectProperty"
  68.   set linecounter to the number of lines in field filelist
  69.   set objectlist to []
  70.   repeat with i = 1 to linecounter
  71.     add(objectlist, value(line i of field filelist))
  72.   end repeat
  73. end
  74.  
  75. on importpict
  76.   global medpct
  77.   set the visible of sprite objpctsprite to 0
  78.   set objnum to the text of field "Current Object"
  79.   set bknum to getaProp(objpropertylist, #bkgnd)
  80.   puppetSprite(1, 1)
  81.   set the memberNum of sprite 1 to the number of member ("backgd" & bknum)
  82.   set medpct to objnum & "10"
  83.   set x to the number of member "NormalView"
  84.   set the fileName of member "NormalView" to the pathName & gpictfilepath & medpct & ".pct"
  85.   set the name of member x to "NormalView"
  86.   set the visible of sprite objpctsprite to 1
  87.   updateStage()
  88. end
  89.  
  90. on showobjname
  91.   puppetSprite(objnamesprite, 1)
  92.   set the castLibNum of sprite objnamesprite to the number of castLib "LObject"
  93.   set the memberNum of sprite objnamesprite to the number of member ("D" & objnum & "0")
  94. end
  95.  
  96. on switchobj whichway
  97.   global importflag
  98.   initialbutton()
  99.   if (whichway = "prev") and (objpos > 1) then
  100.     set objpos to objpos - 1
  101.   else
  102.     if (whichway = "next") and (objpos < count(objectlist)) then
  103.       set objpos to objpos + 1
  104.     end if
  105.   end if
  106.   set objpropertylist to getAt(objectlist, objpos)
  107.   put getaProp(objpropertylist, objpos) into field "Current Object"
  108.   set importflag to 0
  109.   unloadMember(member "NormalView")
  110.   unloadMember(member "CloseView")
  111.   go(label("Restart") - 1)
  112. end
  113.  
  114. on quitvr
  115.   closemovie()
  116.   set gqtvrinstance to 0
  117.   qtvrexit(xtra("QTVRXtra"))
  118.   go("Restart")
  119. end
  120.  
  121. on pressnobtn
  122.   repeat with spriteNum = 116 to 118
  123.     puppetSprite(spriteNum, 0)
  124.   end repeat
  125.   go(label("Restart") + 1)
  126. end
  127.  
  128. on gotoindex
  129.   put "[#FrameNumber: 1, #Text: rect(0, 0, 0, 0), #Flag: 0]" into field "Index Location"
  130.   go(1, "Index")
  131. end
  132.  
  133. on idle
  134.   soundwait(1, "..\Audio\Music3.wav")
  135. end
  136.  
  137. on showcast castlibname
  138.   set the fileName of castLib "LObject" to castlibname
  139. end
  140.